Initial value within the ST-editor is highlighted as faulty.

Symptom: The →initial value for a variable within the ST-editor is highlighted as faulty.

Cause 1: You are using a →variable as initial value for another variable.

Example
Var2 : REAL := Var1;

Solution 1: Correct the initial value so that a constant value is entered. Subsequently, the error highlighting and the message disappear.

Example
Var2 : REAL := 34;

Interested in details? See the following article "Initialization of variables in ST"

Cause 2: The variable is an →in-/out variable and does not support an initial value.

Example
FUNCTION_BLOCK Control
  VAR_IN_OUT
    InOut1 : INT := 25;
  END_VAR
END_FUNCTION_BLOCK

Solution 2: Delete the initial value. Subsequently, the error highlighting and the message disappear.

Example
FUNCTION_BLOCK Control
  VAR_IN_OUT
    InOut1 : INT;
  END_VAR
END_FUNCTION_BLOCK